package com.heima.article.job;

import com.heima.article.service.HotArticleService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ComputeHotArticleJob {
    @Autowired
    HotArticleService hotArticleService;
    @XxlJob("computeHotArticleJob")
    public ReturnT<String> computeHotArticleHandle(String param){
        log.info("定时器执行热点文章计算方法开始========");
        hotArticleService.computeHotArticle();
        log.info("定时器执行热点文章计算方法结束========");
        return ReturnT.SUCCESS;
    }
}
